com.supermap.realspace

Class Layer3D

  • java.lang.Object
    • com.supermap.realspace.Layer3D
  • Direct Known Subclasses:
    Layer3DDynamicObject, Layer3DOSGBFile


    public class Layer3D
    extends java.lang.Object
    3D layer class.

    This class provides a series of setting methods for easy 3D map management, such as 3D layer display and control.

    There are the following types of 3D layers: dataset type 3D layer, map type 3D layer, KML type 3D layer, image file type 3D layer, model cache type 3D layer and vector file layer. Various types of 3D layers can be superimposed and displayed.

    The 3D layer class provides control over the display and selection of the 3D layer. It can control whether the layer can be selected and displayed. You can also use the methods provided by this class to return the selected object in the layer Collection etc.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Layer3D() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clearCustomClipPlane()
      Clear cut plane
      void clipByBox(GeoBox box, BoxClipPart part)
      Crop the renderable part of the layer according to the specified cuboid box and crop area
      Rectangle2D getBounds()
      Return the range of the layer.
      java.lang.String getCaption()
      Returns the title of the 3D layer.
      java.lang.String getDataName()
      Returns the name of the data used by the layer.
      Feature3Ds getFeatures()
      Return the three-dimensional element collection object in the tree structure.
      FieldInfos getFieldInfos()
      Return the attribute field information collection object of the 3D vector layer.
      java.lang.String getName()
      Returns the name of the 3D layer.
      Selection3D getSelection()
      Return to the selection set of 3D layers.
      Rectangle2D getSwipeRegion()
      Get the area where the shutter is opened
      Layer3DType getType()
      Returns the type of 3D layer.
      boolean getVisibleInViewport(int index)
      Get the visibility of the current 3D layer in the specified viewport.
      boolean isReleaseWhenInvisible()
      Return whether the layer is released when it is hidden
      boolean isSelectable()
      Returns whether the objects in the 3D layer can be selected. true means that the mouse can be used to select the object in the corresponding 3D layer, false means the object in the 3D layer is not selectable.
      boolean isSwipeEnable()
      Get whether to open the shutter function
      boolean isVisible()
      Return whether the 3D layer can be displayed.
      void setClipLineColor(Color value)
      Set the cutting edge color.
      void setCustomClipCross(Point3D point3d, Point2D point2d, double rotx, double roty, double rotz, double extrudeDistance)
      Corss cutting analysis, according to the center point, the width and height of the cutting area, the rotation angle of the cutting surface around the X axis, the rotation angle of the cutting surface around the Y axis, the rotation angle of the cutting surface around the Z axis, and the stretching distance of the center point of the cutting area.
      void setCustomClipPlane(Point3D firstPoint, Point3D secondPoint, Point3D thirdPoint)
      Trimming plane analysis, set the positions of the three vertices in order, the result of trimming plane analysis means that only the part of the normal direction of the plane is displayed.
      void setMaxObjectVisibleDistance(double value)
      Set the maximum visible distance of vector objects in the current layer.
      void setReleaseWhenInvisible(boolean value)
      Set whether to release the memory when the layer is hidden.
      void setSelectable(boolean value)
      Returns whether the objects in the 3D layer can be selected. true means that the mouse can be used to select the object in the corresponding 3D layer, false means the object in the 3D layer is not selectable.
      void setSwipeEnable(boolean enable)
      Set whether to turn on the shutter function
      void setSwipeRegion(Rectangle2D rec)
      Set the area to open the shutter
      void setVisible(boolean value)
      Set whether the 3D layer can be displayed. false means the 3D layer is invisible; true means visible.
      void setVisibleInViewport(int index, boolean value)
      Set the visibility of the current 3D layer in the specified viewport.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Layer3D

        public Layer3D()
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the 3D layer.

        The name of a 3D layer uniquely identifies this layer in the 3D map where the 3D layer is located. The logo is not case sensitive.

        Returns:
        The name of the 3D layer.
      • getCaption

        public java.lang.String getCaption()
        Returns the title of the 3D layer.

        The title of the 3D layer is the display name of the layer. For example, the name of the layer displayed in the legend or layout drawing is the title of the layer. Note the difference with the name of the 3D layer.

        Returns:
        The title of the 3D layer.
      • getType

        public Layer3DType getType()
        Returns the type of 3D layer. For the types of 3D layers, please refer to the Layer3DType class.
        Returns:
        The type of 3D layer.
      • isSelectable

        public boolean isSelectable()
        Returns whether the objects in the 3D layer can be selected. true means that the mouse can be used to select the object in the corresponding 3D layer, false means the object in the 3D layer is not selectable.
        Returns:
        Whether the objects in the 3D layer can be selected.
      • setSelectable

        public void setSelectable(boolean value)
        Returns whether the objects in the 3D layer can be selected. true means that the mouse can be used to select the object in the corresponding 3D layer, false means the object in the 3D layer is not selectable.
        Parameters:
        value - A Boolean value that specifies whether the 3D layer is selectable.
      • isVisible

        public boolean isVisible()
        Return whether the 3D layer can be displayed.
        Returns:
        A Boolean value indicating whether the 3D layer can be displayed. false means the 3D layer is invisible; true means visible.
        Default:
        The default value is false, that is, the 3D layer is not visible.
      • setVisible

        public void setVisible(boolean value)
        Set whether the 3D layer can be displayed. false means the 3D layer is invisible; true means visible.
        Parameters:
        value - A Boolean value that specifies whether the 3D layer can be displayed.
      • getFieldInfos

        public FieldInfos getFieldInfos()
        Return the attribute field information collection object of the 3D vector layer.
        Returns:
        Selection3D
      • getSelection

        public Selection3D getSelection()
        Return to the selection set of 3D layers. For details, please refer to the Selection3D category.
        Returns:
        A selection set of 3D layers.
      • getBounds

        public Rectangle2D getBounds()
        Return the range of the layer.

        For KML layers, this method returns the global scope {-180, 90, 180, -90}.

        Returns:
        The extent of the layer.
      • getFeatures

        public Feature3Ds getFeatures()
        Return the three-dimensional element collection object in the tree structure. It is only valid for KML type 3D layers, and the return value is null for other types of 3D layers.

        The figure below shows a three-dimensional feature set (Feature3Ds). It can be seen from the figure that the three-dimensional feature set includes two parts. One is a sub-object of the three-dimensional feature set (that is, the branches and branches of the tree). The leaves), and the other is a three-dimensional feature object (the leaves on the main branch). Each leaf is a three-dimensional feature (Feature3D) object. 1 is the trunk, 2, 3, and 4 are all branches.

        Returns:
        The three-dimensional feature collection object with tree structure.
      • isReleaseWhenInvisible

        public boolean isReleaseWhenInvisible()
        Return whether the layer is released when it is hidden
        Returns:
        Whether to release the memory when the layer is hidden, this attribute being False means that the memory will not be released after the 3D layer is hidden.
      • setReleaseWhenInvisible

        public void setReleaseWhenInvisible(boolean value)
        Set whether to release the memory when the layer is hidden. If this property is False, it means that the memory will not be released after the 3D layer is hidden.
        Parameters:
        value - Whether to release the memory when the layer is hidden.
      • getDataName

        public java.lang.String getDataName()
        Returns the name of the data used by the layer.
        Returns:
        data name. When the data is from a file, the full path name of the file is returned; when the data is from a dataset, the name in the format "DatasetName@DatasourceAlias" is returned; when the data is from a Map, the map name is returned.
      • setVisibleInViewport

        public void setVisibleInViewport(int index,
                                         boolean value)
        Set the visibility of the current 3D layer in the specified viewport. Set the layer to be visible in one viewport and invisible in another viewport, which can realize the contrast display effect of the layer.
        Parameters:
        index - specified viewport index
        value - specifies visibility, true means visible, false means invisible.
      • getVisibleInViewport

        public boolean getVisibleInViewport(int index)
        Get the visibility of the current 3D layer in the specified viewport.
        Parameters:
        index - The specified viewport index.
        Returns:
        true means visible, otherwise false.
      • clipByBox

        public void clipByBox(GeoBox box,
                              BoxClipPart part)
        Crop the renderable part of the layer according to the specified cuboid box and crop area
        Parameters:
        box - The rectangular box specified by
        part - specifies the crop area
      • setCustomClipPlane

        public void setCustomClipPlane(Point3D firstPoint,
                                       Point3D secondPoint,
                                       Point3D thirdPoint)
        Trimming plane analysis, set the positions of the three vertices in order, the result of trimming plane analysis means that only the part of the normal direction of the plane is displayed. The normals follow the right-hand rule, with the counterclockwise normal facing upwards and the clockwise normal facing downwards. The analysis results only show the model structure in the direction of the thumb.
        Parameters:
        firstPoint - the first point
        secondPoint - second point
        thirdPoint - third point
      • clearCustomClipPlane

        public void clearCustomClipPlane()
        Clear cut plane
      • setCustomClipCross

        public void setCustomClipCross(Point3D point3d,
                                       Point2D point2d,
                                       double rotx,
                                       double roty,
                                       double rotz,
                                       double extrudeDistance)
        Corss cutting analysis, according to the center point, the width and height of the cutting area, the rotation angle of the cutting surface around the X axis, the rotation angle of the cutting surface around the Y axis, the rotation angle of the cutting surface around the Z axis, and the stretching distance of the center point of the cutting area.
        Parameters:
        point3d - The coordinate of the center point.
        point2d - The width and height of the cropping area.
        rotx - The angle of rotation of the clipping plane around the X axis.
        roty - The rotation angle of the clipping plane around the Y axis.
        rotz - The rotation angle of the clipping plane around the Z axis.
        extrudeDistance - The extrude distance of the center point of the crop area.
      • setClipLineColor

        public void setClipLineColor(Color value)
        Set the cutting edge color.
        Parameters:
        value - The color specified by
      • getSwipeRegion

        public Rectangle2D getSwipeRegion()
        Get the area where the shutter is opened
        Returns:
        Curtain area, a Rectangle2D object
      • setSwipeRegion

        public void setSwipeRegion(Rectangle2D rec)
        Set the area to open the shutter
        Parameters:
        rec - Shutter area, a Rectangle2D object
      • setSwipeEnable

        public void setSwipeEnable(boolean enable)
        Set whether to turn on the shutter function
        Parameters:
        enable - Whether to turn on the shutter function, true means turn on the shutter function, false means not turn on.
      • isSwipeEnable

        public boolean isSwipeEnable()
        Get whether to open the shutter function
        Returns:
        Whether the layer has the rolling shutter function enabled, true means opening the rolling shutter function, false means not opening it.
      • setMaxObjectVisibleDistance

        public void setMaxObjectVisibleDistance(double value)
        Set the maximum visible distance of vector objects in the current layer.
        Parameters:
        value - Specifies the value of the maximum visible distance.